#ifndef __SCREEN
#define __SCREEN

#include "Spi.h"

#define SCREEN_WIDTH  240
#define SCREEN_HEIGHT 320

typedef struct _Screen Screen;
#define SCREEN(any) ((Screen *)(any))
typedef enum _ScreenOrientation ScreenOrientation;
enum _ScreenOrientation
{
        SCREEN_ORIENTATION_HORIZONTAL,
        SCREEN_ORIENTATION_VERTICAL,
};

#define SCREEN_ORIENTATION SCREEN_ORIENTATION_HORIZONTAL

/**
 * @brief 当前屏幕的背景颜色
 */
extern uint16_t screen_background_color;

/**
 * @brief 获取屏幕全局对象
 */
extern Screen *screen_new_from_global(void);

/**
 * @brief 设定写入像素的区域
 */
extern void screen_set_draw_area(Screen  *self,
                                 uint16_t startX,
                                 uint16_t startY,
                                 uint16_t endX,
                                 uint16_t endY);

/**
 * @brief 向设定区域写入一个像素
 */
extern void screen_draw_pixel(Screen *self, uint16_t pixel_color);

#endif
